import request from '@/utils/request'

// 查询基建类项目需求申请列表
export function listDemand(params) {
  return request({
    url: '/archives/establishDemand/esearch',
    method: 'get',
    params:params
  })
}

// 查询基建类项目需求申请详细
export function getDemand(establishDemandId) {
  return request({
    url: '/system/demand/' + establishDemandId,
    method: 'get'
  })
}

// 新增基建类项目需求申请
export function addDemand(data) {
  return request({
    url: '/archives/establishDemand/eadd',
    method: 'post',
    data: data
  })
}

// 修改基建类项目需求申请
export function updateDemand(data) {
  return request({
    url: '/archives/establishDetails',
    method: 'put',
    data: data
  })
}

// 删除基建类项目需求申请
export function delDemand(establishDemandId) {
  return request({
    url: `/archives/establishDemand/deleteFile/${establishDemandId}`,
    method: 'delete'
  })
}

export function getProjectBaseInfo(establishDemandId){
  return request({
    url:`/archives/establishDemand/elookContent/${establishDemandId}`,
  })
}

export function updateBaseInfo(data){
  return request({
    url:"/archives/establishDemand",
    method:"put",
    data:data
  })
}

export function getUpdateInfo(establishDemandId,stageId){
  return request({
    url:`/archives/establishDemand/elookTime/${establishDemandId}/${stageId}`,
  })
}
export function confirmProject(establishDemandId){
  return request({
    url:`/archives/establishDemand/confirm/${establishDemandId}`,
    method:"post"
  })
}

export function recallProject(establishDemandId){
  return request({
    url:`/archives/establishDemand/withdraw/${establishDemandId}`,
    method:"post"
  })
}

